package player;

/**
 *
 * @author Michael Hanns
 *
 */
public class BookEntryImp implements BookEntry, BookEntryEdit {

    private int id;
    private String title;
    private String description;
    private boolean complete;
    private String completeDescription;

    public BookEntryImp(int id, String title, String description,
            String completeDescription) {
        this.id = id;
        this.title = title;
        this.description = description;
        this.completeDescription = completeDescription;
        this.complete = false;
    }

    public BookEntryImp(int id, boolean complete) {
        this.id = id;
        this.title = "";
        this.description = "";
        this.completeDescription = "";
        this.complete = complete;
    }

    @Override
    public int getID() {
        return id;
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public String getCompleteDescription() {
        return completeDescription;
    }

    @Override
    public String getEntry() {
        String output = id + ". " + title;

        if (complete) {
            output = output + " (COMPLETE)";
        }

        output = output + "\n-----\n\n";
        if (complete) {
            output = output + completeDescription;
        } else {
            output = output + description;
        }

        return output + "\n";
    }

    @Override
    public boolean isComplete() {
        return complete;
    }

    @Override
    public void setID(int id) {
        this.id = id;
    }

    @Override
    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public void setDescription(String desc) {
        this.description = desc;
    }

    @Override
    public void setCompleteDescription(String desc) {
        this.completeDescription = desc;
    }

    @Override
    public void setComplete(boolean flag) {
        this.complete = flag;
    }
}
